﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VCommons.Http;

namespace Web.Core
{
    /// <summary>
    /// 当前用户模型，默认通过session存储
    /// </summary>
    public class CurrentLoginInfo
    {
        /// <summary>
        /// 是否为cookies方式
        /// </summary>
        static SerializationType serializationType = SerializationType.Session;//可以在配置文件中读出
        static ISerialization _instance;
        static CurrentLoginInfo()
        {
            if ((serializationType & SerializationType.Cookies) > 0)
                _instance = new CookiesSerialization();
            if ((serializationType & SerializationType.Session) > 0)
                _instance = new SessionSerialization();
        }
        /// <summary>
        /// 登陆消息功能类
        /// </summary>
        public static ISerialization Instance
        {
            get
            {
                return _instance;
            }
        }

    }
}